//
//  MyTableViewCell.m
//  TableSelectDemo
//
//  Created by ebeijia on 15/11/26.
//  Copyright © 2015年 ebeijia. All rights reserved.
//

#import "MyTableViewCell.h"
#import "NotifyModel.h"

@implementation MyTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.label = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, 50, 60)];
        self.label.text = @"未读";
        self.label.textColor = [UIColor redColor];
        [self addSubview:self.label];
    }
    return self;
}

//- (id)initWithFrame:(CGRect)frame
//{
//    self = [super initWithFrame:frame];
//    if (self) {
//        self.label = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, 50, 60)];
//        self.label.text = @"未读";
//    self.label.textColor = [UIColor redColor];
//        [self addSubview:self.label];
//    }
//    return self;
//}

- (void)drawCell:(NotifyModel *)model
{
    
    
    if ([model.isRead isEqualToString:@"1"]) {
        self.label.text = @"已读";
        self.label.textColor = [UIColor blackColor];
    }else {
        self.label.text = @"未读";
        self.label.textColor = [UIColor redColor];
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
